import React, { Suspense, lazy } from "react";
import { Provider } from "react-redux"; // redux 管理
import createStore from "./redux/store/index.js";
import MainComp from "./pages/Main/index.js";
import {
  Route,
  Switch,
  Redirect,
  HashRouter as Router,
} from "react-router-dom";
import { Spin } from "antd";
import "./app.css";
const store = createStore();
function App() {
  return (
    <Provider store={store}>
      <Router>
        <Suspense
          fallback={
            <div style={{ paddingTop: "50%", textAlign: "center" }}>
              <Spin tip="加载中..." />
            </div>
          }
        >
          <Switch>
            <Route path={`/`} component={MainComp} />
          </Switch>
        </Suspense>
      </Router>
    </Provider>
  );
}

export default App;
